<template>
    <div>
        <ul>
            <li style="--i: 6; --clr: #1877f2">
                <a href="#"><span><i class="fa-brands fa-facebook-f"></i></span>Facebook</a>
            </li>
            <li style="--i: 5; --clr: #25d366">
                <a href="#"><span><i class="fa-brands fa-whatsapp"></i></span>Whatsapp</a>
            </li>
            <li style="--i: 4; --clr: #1da1f2">
                <a href="#"><span><i class="fa-brands fa-twitter"></i></span>Twitter</a>
            </li>
            <li style="--i: 3; --clr: #c32aa3">
                <a href="#"><span><i class="fa-brands fa-instagram"></i></span>Instagram</a>
            </li>
            <li style="--i: 2; --clr: #ff0000">
                <a href="#"><span><i class="fa-brands fa-youtube"></i></span>Youtube</a>
            </li>
            <li style="--i: 1; --clr: #0a66c2">
                <a href="#"><span><i class="fa-brands fa-linkedin"></i></span>Linkedin</a>
            </li>
        </ul>
    </div>
</template>

<script setup lang="ts">
import {
    ref,
    reactive,
    toRefs,
    onBeforeMount,
    onMounted,
    watchEffect,
    computed,
} from "vue";
import { useStore } from "vuex";
import { useRoute, useRouter } from "vue-router";
/**
 * 仓库
 */
const store = useStore();
/**
 * 路由对象
 */
const route = useRoute();
/**
 * 路由实例
 */
const router = useRouter();
//console.log('1-开始创建组件-setup')
/**
 * 数据部分
 */
const data = reactive({});
onBeforeMount(() => {
    //console.log('2.组件挂载页面之前执行----onBeforeMount')
});
onMounted(() => {
    //console.log('3.-组件挂载到页面之后执行-------onMounted')
});
watchEffect(() => { });
// 使用toRefs解构
// let { } = { ...toRefs(data) }
defineExpose({
    ...toRefs(data),
});
</script>
<style scoped lang="scss">
ul {
    position: relative;
    transform: skewY(-15deg);
}

ul li {
    position: relative;
    list-style: none;
    width: 120px;
    background: #3e3f46;
    padding: 15px;
    transition: 0.5s;
    z-index: calc(1 * var(--i));
}

ul li:hover {
    transform: translateX(-50px);
    background: var(--clr);
}

ul li::before {
    content: "";
    position: absolute;
    top: 0;
    left: -40px;
    width: 40px;
    height: 100%;
    background: #3e3f46;
    filter: brightness(0.7);
    transform-origin: right;
    transform: skewY(45deg);
    transition: 0.5s;
}

ul li:hover::before {
    background: var(--clr);
    filter: brightness(0.7);
}

ul li::after {
    content: "";
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    height: 40px;
    background: #3e3f46;
    filter: brightness(0.9);
    transform-origin: bottom;
    transform: skewX(45deg);
    transition: 0.5s;
}

ul li:hover::after {
    background: var(--clr);
    filter: brightness(0.9);
}

ul li a {
    text-decoration: none;
    color: #999;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: 0.5s;
}

ul li:hover a {
    color: #fff;
}

ull i:last-child::after {
    box-shadow: -120px 120px 20px rgba(0, 0, 0, 0.25);
}

ul li span {
    position: absolute;
    top: 0;
    left: -40px;
    width: 40px;
    height: 100%;
    transform-origin: right;
    transform: skewY(45deg);
    transition: 0.5s;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
    font-size: 1.25em;
}

ul li:hover span {
    opacity: 1;
}
</style>
